﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CCActionManager : SSActionManager, ISSActionCallback {
	public RoundController roundController;
	private CCFlyAction action;
	public DiskFactory factory;

	protected new void Start() {
		roundController = (RoundController)SSDirector.getInstance ().currentSceneController;
		roundController.actionManager = this;
		factory = Singleton<DiskFactory>.Instance;
	}

	// Update is called once per frame
	protected new void Update ()
	{
		base.Update ();
	}
		
	// #region ISSActionCallback implementation
	public void SSActionEvent (SSAction source, SSActionEventType events = SSActionEventType.Competeted, int intParam = 0, string strParam = null, Object objectParam = null)
	{
		factory.FreeDisk(source.gameobject);
	}
	// #endregion

	public void MoveDisk(GameObject disk) {
		action = CCFlyAction.GetSSAction(disk.GetComponent<DiskAttributes>().speedX, disk.GetComponent<DiskAttributes>().speedY);
		RunAction(disk, action, this);
	}
}

